import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class FileWriter {
    public static void main(String[] args) {
        try {
            FileOutputStream stream = new FileOutputStream("stream.txt");

            stream.write('a');

            byte[] temp = {'b', 'c', 'd', 'e', 'f', 'g'};
            stream.write(temp);

            stream.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }

    }
}
